Merged
Conversation
Introduces a body size limit middleware to protect against large payload attacks, configurable via the RustApi builder. Adds Prometheus-based metrics middleware (feature-gated) with a /metrics endpoint, and exposes error environment configuration and error IDs for improved error handling and observability. Updates dependencies and public API exports accordingly.
Introduce detailed module-level documentation for core crates, add compile-time and runtime route path validation, and provide property-based tests for path validation. Add CI workflow, changelog, contributing guidelines, dual MIT/Apache-2.0 licenses, and new example applications (auth-api, crud-api). Update workspace and dependencies to include new examples and features.
…agger UI - JwtLayer now supports skip_paths() to exclude paths from JWT validation - Added docs_with_auth() for Basic Auth protected documentation - Updated auth-api example to demonstrate protected docs - Bumped version to 0.1.2
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Swagger UI Basic Authentication support to protect API documentation in production environments. The primary focus is on enabling authentication for the /docs endpoint while maintaining backward compatibility with the existing unauthenticated documentation feature.
Key Changes:
- Added
docs_with_auth()anddocs_with_auth_and_info()methods to RustApi for Basic Auth protected Swagger UI - Enhanced JwtLayer with
skip_paths()to exclude public endpoints from JWT validation - Updated auth-api example to demonstrate protected documentation
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/rustapi-core/src/app.rs | Added Basic Auth protected docs methods and helper functions |
| crates/rustapi-extras/src/jwt/mod.rs | Added skip_paths configuration for JWT middleware |
| examples/auth-api/src/main.rs | Demonstrates protected docs with Basic Auth |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.